package frame;

import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import java.awt.Color;

public class ManagerEnroll {

    private JFrame frame;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    ManagerEnroll window = new ManagerEnroll();
                    window.frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the application.
     */
    public ManagerEnroll() {
        initialize();
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new JFrame();
        frame.setBounds(100, 100, 771, 567);
        frame.setLocationRelativeTo(null); // Ĭ Ͼ     ʾ
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(null);


        frame.setVisible(true);

        //      м            Զ
        MYPanel3 bg = new MYPanel3();
        bg.setBounds(0, 0, 753, 528);
        //           ӵ frame  Ĭ ϴ
        frame.getContentPane().add(bg);
        //     bg Ĳ   Ϊ   Բ
        bg.setLayout(null);

        JLabel lblL = new JLabel("\u6B22\u8FCE\u6765\u5230\u7BA1\u7406\u5458\u754C\u9762");
        lblL.setForeground(Color.WHITE);
        lblL.setFont(new Font("    ", Font.PLAIN, 30));
        lblL.setBounds(225, 61, 318, 52);
        bg.add(lblL);

        JButton button = new JButton("\u7EBF\u8DEF\u66F4\u6539");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                SeekWays sw=new SeekWays();
                frame.setVisible(false);
            }
        });
        button.setBounds(110, 285, 113, 27);
        bg.add(button);

        JButton button_1 = new JButton("\u53F8\u673A\u4FE1\u606F\u4FEE\u6539");
        button_1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                DriverTableFrame dtf=new DriverTableFrame();
                frame.setVisible(false);
            }
        });
        button_1.setBounds(307, 285, 158, 27);
        bg.add(button_1);

        JButton button_2 = new JButton("\u4E2A\u4EBA\u4FE1\u606F");
        button_2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                PersonalinfoFrame pif=new PersonalinfoFrame();
                frame.setVisible(false);
            }
        });
        button_2.setBounds(551, 285, 113, 27);
        bg.add(button_2);

        JMenuBar menuBar = new JMenuBar();
        frame.setJMenuBar(menuBar);

        JMenu menu = new JMenu("\u5F00\u59CB");
        menuBar.add(menu);

        JMenuItem menuItem = new JMenuItem("\u4FE1\u606F\u4FEE\u6539");
        menu.add(menuItem);
        menuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                DriverTableFrame dtf=new DriverTableFrame();
            }
        });


        JMenu menu_1 = new JMenu("\u5E2E\u52A9");
        menuBar.add(menu_1);
    }
}
//    ͼ
class MYPanel3 extends JPanel {
    private Image img;

    // ʵ ֹ  췽
    public MYPanel3() {
        // TODO Auto-generated constructor stub
        //  ڹ  췽   ж   Ҫ  ͼƬ  Դ   г ʼ
        ImageIcon icon = new ImageIcon(UsersLoginFrame.class.getResource("/images/    ͼ3.jpg"));
        //   icon    ת    img   ͻ
        img = icon.getImage();
    }

    // JPanel     ṩ  һ        ʵ ֡           Ĺ
    @Override
    protected void paintComponent(Graphics g) {
        // TODO Auto-generated method stub
        g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), null);
    }

}